import YW from '@/common/jyw-sdk'
import YW3 from '@/common/jyw3-sdk.min'
import XH from '@/common/xh-ybjssdk'
import windowsSDK from '@/common/windows-sdk'
import {
	initSocket
} from '@/common/windows-sdk'
import store from '@/store/index'
import router from '@/router/index'
import {
	Toast
} from 'vant';
import {
	getOrderNumber,
} from '@/utils/index'
import containerSDK from '@/common/container-sdk'
import dict from '@/common/dict'
import {
	decode
} from '@/api/medical-insurance-decode'
import {
	getSlipPrinterStatus,
	textToSpeech,
	onPrintTicket,
	onPrintBitmap,
} from '@/api/xuhui-android'
import CryptoJS from "crypto-js";
// import {
// 	footerXH,
// 	headerXH,
// } from '@/common/slipPrintConfigForXH'
import alipayLOT from '@/common/alipayLOT-sdk';
import {getDeviceInfo} from "@/api/common";

export default {
	//初始化
	init(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'XH') {
			XH.config({
				openLog: true,
			})
			params.success();
		} else if (sdkModule == 'YW3') {
			YW3.init({
				appId: '29915722713305395276239225356928', //应用 Id
				isvId: '299157173164944384', //商户 id
				serverPublicKey: '0425E532B0333F40C2E8B4905D2AE8A31E690CDBA12E0EE20B85888DC73FA6D7EDEA86450A1459B94705CE77BF305D91666F5B8FF85CB8315F8D1CD4744F664955', //服务端公钥
				isvPrivateKey: '00E43FE3031A3FD0730F5FE0FD121A05124EEAF8DD993FA1ABCE021F20F6CD650A', //Isv 应用私钥
				isvSecretKey: '61233530373133303733393936323537', //Isv 应用密钥
				success: (res) => {
					console.log(`${sdkModule}-SDK[初始化成功]`)
					params && params.success && params.success();
				},
				fail: (err) => {
					console.log(err, 'YW3.init.fail')
				}
			})
		} else if (sdkModule == 'Windows') {
			containerSDK.init();
			initSocket({
				success: () => {
					// console.log(`${sdkModule}-SDK[初始化成功]`)
					params && params.success && params.success();
					windowsSDK.ledLight({
						data: {
							rgb: '蓝',
							switch: 'on'
						}
					})
				},
				fail: () => {
					params && params.fail && params.fail();
				}
			});
		} else if (sdkModule == 'alipayLOT') {
			alipayLOT.init();
			params.success();
		} else {
			params.success();
		}
	},
	//获取设备号
	getSerialNumber(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {
			YW.getSerialNumber({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'YW3') {
			YW3.getSerialNumber({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					console.log(err)
					// params.fail(err);
				}
			})
		} else if (sdkModule == 'XH') {
			XH.getSerialNumber({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'alipayLOT') {
			alipayLOT.getSerialNumber({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else {
			windowsSDK.getSerialNumber({
				success: (res) => {
					if (res.ERROR == "SUCCESS") {
						params.success({
							serialNumber: res.machineId
						});
					} else {
						params.fail(res)
					}
				}
			})
		}
	},
	//刷身份证（监听模式，有页面）
	getUserInfoByIdcard(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {
			YW.getUserInfoByIdcard({
				success: (res) => {
					params.success({
						name: res.certName,
						idCard: res.certNo,
						...res
					});
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'YW3') {
			YW3.getUserInfoByIdcard({
				success: (res) => {
					params.success({
						name: res.certName,
						idCard: res.certNo,
						...res
					});
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'XH') {
			XH.getUserInfoByIdcard({
				success: (res) => {
					params.success({
						name: res.certName,
						idCard: res.certNo,
						...res
					});
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'alipayLOT') {
			alipayLOT.getUserInfoByIdcard({
				success: (res) => {
					params.success({
						name: res.data.name,
						idCard: res.data.idcardno,
						...res.data,
					});
				},
				fail: (res) => {
					params.fail(res);
				}
			})
		}
	},
	//扫码（监听模式，有页面）
	getScanCode(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {
			YW.getScanCode({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'YW3') {
			YW3.getScanCode({
				success: (res) => {
					params.success({
						...res,
						scanCode: res.scanCode.trim(),
					});
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else {
			XH.getScanCode({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		}
	},
	//刷脸激活电子凭证
	activeECByFace(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {
			YW.getAuthNoByFace({
				orgId: myConfig.medicalInsuranceNumber, //机构 ID，医保定点 机构代码
				operatorId: store.state.deviceInfo.adminId, //收款员编号
				operatorName: store.state.deviceInfo.adminName, //收款员姓名
				businessType: '', //用码业务类型
				officeId: '', //医保科室编号
				officeName: '', //科室名称
				outBizNo: getOrderNumber(), //定点医药机构本次 业务流水号，不可重 复，每次请求需要唯一
				success: (res) => {
					params.success({
						name: res.userName,
						idCard: res.idNo,
						...res,
					});
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'YW3') {
			YW3.activeECByFace({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		}
	},
	//刷脸获取用户信息
	getUserInfoByFace(params) {
		let sdkModule = store.state.system.sdkModule;
		let item = dict.businessType.find((t) => {
			return t
			return t.url == store.state.login.info.callBackUrl
		});
		let medicalInsuranceData = {
			orgId: myConfig.medicalInsuranceNumber, //机构 ID，医保定点 机构代码
			operatorId: store.state.deviceInfo.adminId, //收款员编号
			operatorName: store.state.deviceInfo.adminName, //收款员姓名
			// businessType: '01101', //用码业务类型
			businessType: item ? item.value : '01101', //用码业务类型
			officeId: '32760', //医保科室编号
			officeName: '消化内科', //科室名称
			outBizNo: getOrderNumber(), //定点医药机构本次 业务流水号，不可重 复，每次请求需要唯一
		}
		if (sdkModule == 'YW') {
			YW.getAuthNoByFace({
				...medicalInsuranceData,
				success: async (res) => {
					if (res.ecQrCode || res.authNo) {
						let toast = Toast.loading({
							message: '加载中...',
						});
						const nationQrCodeRes = await decode({
							ecqrcode: res.ecQrCode || res.authNo,
						});
						toast.clear();
						if (nationQrCodeRes.success) {
							let data = nationQrCodeRes.data;
							params.success({
								name: data.userName,
								idCard: data.idNo,
								rawData: nationQrCodeRes,
								medicalInsuranceQrCodeNo: data.ecToken, //医保电子凭证token
							});
						} else {
							params.fail({
								msg: '解码服务出错'
							});
						}
					} else {
						//没解出没有姓名，身份证
						params.fail({
							msg: '该机器目前无法获取用户信息'
						});
					}

				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'YW3') {
			YW3.getAuthNoByFace({
				...medicalInsuranceData,
				success: async (res) => {
					console.log(res, 'YW3.getAuthNoByFace')
					let toast = Toast.loading({
						message: '加载中...',
					});
					const nationQrCodeRes = await decode({
						ecqrcode: res.authNo,
						bizNo: res.bizNo,
						outBizNo: res.outBizNo,
					});
					toast.clear();
					if (nationQrCodeRes.success) {
						let data = nationQrCodeRes.data;
						params.success({
							name: data.userName,
							idCard: data.idNo,
							rawData: nationQrCodeRes,
							medicalInsuranceQrCodeNo: data.ecToken, //医保电子凭证token
						});
					} else {
						params.fail({
							msg: '解码服务出错'
						});
					}

				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'XH') {
			XH.getUserInfoByFace({
				success: (res) => {
					params.success({
						data: {
							name: res.userName,
							idCard: res.idNo,
							...res,
						}
					});
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'alipayLOT') {
			alipayLOT.getUserInfoByFace({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else {
			containerSDK.getUserInfoByFace({
				data: {
					data: medicalInsuranceData,
					"orgId": myConfig.medicalInsuranceNumber,
				},
				success: (res) => {
					containerSDK.getUserInfoByFaceCheck({
						data: {
							data: {
								...medicalInsuranceData,
								authNo: res.authNo,
							},
							"orgId": myConfig.medicalInsuranceNumber,
						},
						success: (res2) => {
							params.success({
								name: res2.userName,
								idCard: res2.idNo,
								medicalInsuranceQrCodeNo: res2.ecToken, //医保电子凭证token
								// payCode: res.payCode, //刷脸支付code,auth方法返回的
								payCode: res2.payCode, //刷脸支付code
								rawData: res2.rawData,
								...res,
							});
						},
						fail: (err) => {
							params.fail(err);
						},
					})
				},
				fail: (err) => {
					params.fail(err);
				}
			})
			// windowsSDK.getUserInfoByFace({
			// 	success: (res) => {
			// 		if (res.ERROR == "SUCCESS") {
			// 			params.success({
			// 				name: res.NAME,
			// 				idCard: res.IDCARD,
			// 				phone: res.PHONE,
			// 			});
			// 		} else {
			// 			params.fail(res);
			// 		}
			// 	}
			// })
		}
	},
	//刷脸获取付款码
	getPayCodeByFace(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {

		} else if (sdkModule == 'YW3') {

		} else if (sdkModule == 'XH') {

		} else {
			containerSDK.getPayCodeByFace({
				data: {
					data: {
						operatorId: store.state.deviceInfo.adminId, //收款员编号
						operatorName: store.state.deviceInfo.adminName, //收款员姓名
						outBizNo: getOrderNumber(), //定点医药机构本次 业务流水号，不可重 复，每次请求需要唯一
						payType: 'FACE',
						...params.data,
					},
					"orgId": myConfig.medicalInsuranceNumber,
				},
				success: (res) => {
					params.success({
						payCode: res.payCode,
					});
				},
				fail: (err) => {
					params.fail(err);
				}
			})
			// windowsSDK.getPayCodeByFace({
			// 	success: (res) => {
			// 		if (res.ERROR == "SUCCESS") {
			// 			params.success({
			// 				payCode: res.PAYCODE,
			// 			});
			// 		} else {
			// 			params.fail(res);
			// 		}
			// 	}
			// })
		}
	},
	//控制机器灯光(旭辉机器)
	lampOpen(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'XH') {
			XH.lampOpen({
				type: params.type
			})
		}
	},
	//凭条打印机(查询状态)
	async querySlipPrint(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {

		} else if (sdkModule == 'YW3') {
			const res = await getSlipPrinterStatus();
			console.log(res)
			if (res.success || res.msg.indexOf('纸将尽') > -1) {
				params.success(res);
			} else {
				params.fail && params.fail(res);
			}
		} else if (sdkModule == 'XH') {
			XH.querySlipPrint({
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail && params.fail(err);
				}
			})
		} else {
			windowsSDK.querySlipPrint({
				success: (res) => {
					if (res.ERROR == "SUCCESS" || res.ERROR.indexOf('纸将尽') > -1) {
						params.success(res);
						windowsSDK.ledLight({
							data: {
								rgb: '蓝',
								switch: 'on'
							}
						})
					} else {
						params.fail({
							...res,
							msg: res.ERROR
						})
						windowsSDK.ledLight({
							data: {
								rgb: '红',
								switch: 'on'
							}
						})
					}
				}
			})
		}
	},
	//凭条打印机(图片)
	slipPrintForImg(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW3' || sdkModule == 'XH') {
			// onPrintBitmap({
			// 	photoStr: params.base64,
			// 	// width: params.width,
			// 	// height: params.height,
			// 	line: 4,
			// })
		} else if (sdkModule == 'Windows') {
			windowsSDK.slipPrintForImg({
				data: params,
				success: (res) => {
					if (res.ERROR == 'SUCCESS') {
						params.success && params.success(res);
					} else {
						params.fail && params.fail(res);
					}
				}
			})
		}
	},
	//凭条打印机(打印)
	slipPrint(params = {}) {
		let sdkModule = store.state.system.sdkModule;
		let isWindows = sdkModule == 'Windows';
		let list = [
			// ...headerXH({
			// 	title: params.title,
			// }),
			...params.data,
			// ...footerXH(),
		]
		list = list.map((t) => {
			if (t.type && t.type != 1) {
				if (isWindows) {
					return t
				} else {
					return {
						type: t.type,
						line: t
					}
				}
			} else {
				let content = '';
				if (t.content) {
					content = t.alignment == 1 ? t.content : `   ${t.content}`;
				} else {
					content = `   ${t.label}：${t.value}`;
				}

				let line = {
					// iImme: 1, // 是否换行 0：换行  1：不换行
					lineSpace: 40, // 行间距 取值0-127，单位0.125mm
					alignment: 0, // 设置字符对齐 0 左、1 居中、2 右
					textSize: 1, // 设置文本放大 取值(1-8)
					bold: 0, // 设置字体加粗  0 不加粗、1 加粗
					...t,
					content: content, // 打印内容
				};
				if (isWindows) {
					return {
						type: 1, //1：文字，2：换行，3 条形码，4，二维码，5，多列打印（打印列数根据数据个数决定2~4）6:模板打印
						...line,
					}
				} else {
					return {
						type: 1,
						line: line,
					}
				}

			}
		})
		console.log(JSON.stringify(list))
		if (sdkModule == 'YW3') {
			//安卓接口中文需要转base64
			list.forEach((t) => {
				if (t.type == 1) {
					let utf8 = CryptoJS.enc.Utf8.parse(t.line.content);
					let base64 = CryptoJS.enc.Base64.stringify(utf8);
					t.line.content = base64;
				}
			})
			onPrintTicket({
				data: list
			})
		} else if (sdkModule == 'Windows') {
			windowsSDK.slipPrint({
				data: list,
				success: (res) => {
					if (res.ERROR == 'SUCCESS') {
						params.success && params.success(res);
					} else {
						params.fail && params.fail(res);
					}
				}
			})
		} else if (sdkModule == 'XH') {
			XH.slipPrint({
				data: list,
				success: (res) => {
					params.success && params.success(res);
				},
				fail: (err) => {
					params.fail && params.fail(err);
				}
			})
		}
	},
	//报告打印机(查询状态)
	queryReportPrint(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {

		} else if (sdkModule == 'XH') {
			XH.queryReportsPrint({
				success: (res) => {
					params.success(res)
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else {
			windowsSDK.queryReportPrint({
				success: (res) => {
					// res={
					// 	ERROR:'SUCCESS',
					// 	STATUS:'打印机故障：Status:trayEmpty,Tray:All,Status:trayEmpty,Tray:Tray3,Status:trayEmpty,Tray:Tray1,Status:trayEmpty,Tray:Tray2,Status:trayEmpty',
					// }
					// debugger
					if (res.ERROR == "SUCCESS") {
						let successArr = ['正常', '休眠', '准备就绪', 'ready', 'Ready', '打印机忙', '墨粉将用完', '硒鼓寿命将到',
							'纸将尽'
						]
						if (successArr.indexOf(res.STATUS) > -1) {
							params.success(res);
							windowsSDK.ledLight({
								data: {
									rgb: '蓝',
									switch: 'on'
								}
							})
						} else {
							Toast(res.STATUS);
							params.fail(res)
							windowsSDK.ledLight({
								data: {
									rgb: '红',
									switch: 'on'
								}
							})
						}
					} else {
						params.fail({
							...res,
							msg: res.ERROR,
						})
						windowsSDK.ledLight({
							data: {
								rgb: '红',
								switch: 'on'
							}
						})
					}
				}
			})
		}
	},
	//报告打印机(打印)
	reportPrint(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {

		} else if (sdkModule == 'YW3') {
			YW3.printA4({
				files: params.files,
				numOfCopies: 1,
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else if (sdkModule == 'XH') {
			XH.reportsPrint({
				pdfUrl: params.data.pdfUrl,
				success: (res) => {
					params.success(res);
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		} else {
			windowsSDK.reportPrint({
				data: params.data,
				success: (res) => {
					if (res.ERROR == "SUCCESS") {
						params.success(res);
					} else {
						params.fail(res)
					}
				}
			})
		}
	},
	//语音播报
	speak(params) {
		let sdkModule = store.state.system.sdkModule;
		switch (sdkModule) {
			case 'YW':
				// if (document.querySelector(`.${params.type}`)) {
				// 	document.querySelector(`.${params.type}`).play()
				// }
				break;
			case 'YW3':

				// let utf8 = CryptoJS.enc.Utf8.parse(params.text);
				// let base64 = CryptoJS.enc.Base64.stringify(utf8);
				// textToSpeech({
				// 	"text": base64, //转base64
				// 	"type": 1
				// })
				break;
			case 'XH':
				XH.speak({
					text: params.text
				})
				break;
			case 'Windows':
				windowsSDK.speak({
					data: {
						Content: params.text
					}
				})
				break;
			case 'alipayLOT':
				alipayLOT.speak({
					data: params
				})
				break;
			default:
				break;
		}
	},
	//刷社保卡（监听模式，无页面）
	onMonitorSSCardReader(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {
			YW.useReadSsCard({
				time: params.time,
				success: (res) => {
					params.success({
						name: res.data.certName,
						idCard: res.data.certNo,
						...res.data
					});
				},
				fail: (err) => {
					params.fail(err);
					console.log('fail')
				}
			})
		} else if (sdkModule == 'XH') {
			XH.onMonitorSSCardReader((res) => {
				params.success({
					name: res.data.certName,
					idCard: res.data.certNo,
					...res.data
				});
			})
		}
	},
	//关闭刷社保卡（监听模式，无页面）
	offMonitorSSCardReader() {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {
			YW.closeReadSsCard({
				success: (res) => {
					console.log('success')
				},
				fail: (err) => {
					console.log('fail')
				}
			})
		} else if (sdkModule == 'XH') {
			XH.offMonitorSSCardReader();
		} else {

		}
	},
	//扫码（监听模式，无页面）
	onMonitorScanCode(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {

		} else {
			XH.onMonitorScanCode((res) => {
				params.success(res);
			})
		}
	},
	//关闭扫码（监听模式，无页面）
	offMonitorScanCode() {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW') {

		} else {
			XH.offMonitorScanCode();
		}
	},
	//刷身份证（监听模式，无页面）
	onMonitorIdCardReader(callback) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'Windows') {
			windowsSDK.onMonitorIdCardReader((res) => {
				callback({
					name: res.IDNAME,
					idCard: res.IDCARDNO,
					address: res.ADDRESS,
					...res
				})
			})
		} else {
			console.log('该sdk方法缺失')
		}
	},
	//刷社保卡（单次）
	readSsCard(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'Windows') {
			windowsSDK.readSsCard2({
				data: params.data,
				success: (res) => {
					params.success({
						name: res.NAME,
						idCard: res.IDNUMBER,
						...res,
					});
				}
			})
		}
	},
	//回到首页
	backHome() {
		let sdkModule = store.state.system.sdkModule;
		console.log('调用了backHome', sdkModule)
		if (sdkModule == 'YW3') {
			YW3.backHome()

		} else if (sdkModule == 'YW') {
			YW.backToNative()
		} else if (sdkModule == 'alipayLOT') {
			alipayLOT.backHome({
				success: (res) => {

				},
				fail: (res) => {

				}
			})
		}
		// //调用下路由返回首页，用来处理医保sdk的返回首页之后，程序路由没变化导致的各种问题
		// router.replace({
		// 	path: '/index'
		// })
	},
	//退卡
	outCard() {
		windowsSDK.outCard()
	},
	//打开灯光
	openLight(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'Windows') {
			windowsSDK.openLight({
				data: params.data,
				success: (res) => {
				}
			})
		}
	},
	//关闭灯光
	closeLight(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'Windows') {
			windowsSDK.closeLight({
				data: params.data,
				success: (res) => {
				}
			})
		}
	},
	//页面无操作超时
	setTouchTimeout(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW3') {
			YW3.setTouchTimeout({
				noTouchTimeOut: 720, //60*12，一天的时间
				secondCheckTimeout: 5
			})
		}
	},
	//关闭app
	closeApp() {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'YW3') {
			YW3.backHome();
		} else if (sdkModule == 'Windows') {
			containerSDK.closeApp();
		}
	},
	//刷脸核身
	faceVerify(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'alipayLOT') {
			alipayLOT.faceVerify({
				data: params.data,
				success: (res) => {
					params.success(res);
				},
				fail: (res) => {
					params.fail(res);
				}
			})
		} else if (sdkModule == 'XH') {
			/*console.log(params.data.idCard, params.data, 'faceVerify')
			XH.realName({
				certNo: params.data.idCard,
				certName: params.data.name,
				success: (res) => {
					params.success(res);
				},
				fail: (res) => {
					params.fail(res);
				}
			})*/
			XhAggregation.getUserInfoByFace({
				success: (res) => {
					if(params.data.idCard==res.data.idCard){
						params.success(res);
					}else {
						params.fail(res);
					}
				},
				fail: (err) => {
					params.fail(err);
				}
			})
		}
	},
	//刷脸核身
	getConfig(params) {
		let sdkModule = store.state.system.sdkModule;
		if (sdkModule == 'alipayLOT') {
			alipayLOT.getConfig({
				data: params.data,
				success: (res) => {
					params.success(res);
				},
				fail: (res) => {
					params.fail(res);
				}
			})
		} else if (sdkModule == 'XH') {

		}
	},

}